﻿@inject IStringLocalizer<BootstrapBlazor.Shared.Samples.Modals> Localizer

<Button OnClick="() => ShownCallbackModal.Toggle()">@Localizer["ModalsNormalPopups"]</Button>
<Modal @ref="ShownCallbackModal" OnShownAsync="OnShownCallbackAsync">
    <ModalDialog Title="ShownCallbackAsync 回调示例">
        <BodyTemplate>
            <div>@Localizer["ModalsShownCallbackAsyncIntro"]</div>
        </BodyTemplate>
    </ModalDialog>
</Modal>
<ConsoleLogger @ref="Logger" class="mt-3" />

@code {
    [NotNull]
    private Modal? ShownCallbackModal { get; set; }

    [NotNull]
    private ConsoleLogger? Logger { get; set; }

    private Task OnShownCallbackAsync()
    {
        Logger.Log("弹窗已显示");
        return Task.CompletedTask;
    }
}
